/*
  cpgf Library
  Copyright (C) 2011, 2012 Wang Qi http://www.kbasm.com/
  All rights reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/


#ifndef __GBYTEARRAYAPI_H
#define __GBYTEARRAYAPI_H

#include "cpgf/gapi.h"


namespace cpgf {

struct IByteArray : IExtendObject {
    virtual void * G_API_CC getMemory() = 0;

    virtual uint32_t G_API_CC getPosition() = 0;
    virtual void G_API_CC setPosition(uint32_t position) = 0;

    virtual uint32_t G_API_CC getLength() = 0;
    virtual void G_API_CC setLength(uint32_t length) = 0;

    virtual int8_t G_API_CC readInt8() = 0;
    virtual int16_t G_API_CC readInt16() = 0;
    virtual int32_t G_API_CC readInt32() = 0;
    virtual int64_t G_API_CC readInt64() = 0;

    virtual uint8_t G_API_CC  readUint8() = 0;
    virtual uint16_t G_API_CC readUint16() = 0;
    virtual uint32_t G_API_CC readUint32() = 0;
    virtual uint64_t G_API_CC readUint64() = 0;
    
    virtual float G_API_CC readFloat32() = 0;
    virtual double G_API_CC readFloat64() = 0;

    virtual void G_API_CC readBuffer(void * buffer, uint32_t length) = 0;

    virtual void G_API_CC writeInt8(int8_t value) = 0;
    virtual void G_API_CC writeInt16(int16_t value) = 0;
    virtual void G_API_CC writeInt32(int32_t value) = 0;
    virtual void G_API_CC writeInt64(int64_t value) = 0;

    virtual void G_API_CC writeUint8(uint8_t value) = 0;
    virtual void G_API_CC writeUint16(uint16_t value) = 0;
    virtual void G_API_CC writeUint32(uint32_t value) = 0;
    virtual void G_API_CC writeUint64(uint64_t value) = 0;

    virtual void G_API_CC writeFloat32(float value) = 0;
    virtual void G_API_CC writeFloat64(double value) = 0;
    
    virtual void G_API_CC writeBuffer(const void * buffer, uint32_t length) = 0;
};


}



#endif


